Advanced Topics

"Get Info" Options

When using the "Get Info" menu item in expert mode, Default Folder allows you to modify a number of important file and folder characteristics.  Changing some of these can cause the file or folder to become invisible or inaccessible to most applications, so make sure you understand the impact of what you are changing!  

Following is a list that describes the various options available in the "Get Info" dialog for files, illustrated below.

Name Locked:  Locks the name of the file so it cannot be changed in the Finder.

File Locked:  Locks the file itself so no changes can be saved.

Type:  The Mac OS uses this 4-character code to determine which applications can open which files.  For example, plain text files have a type of 'TEXT' which is recognized by all word processors and text editors, regardless of which program created the file.

Creator:  This 4-character field is a code which uniquely identifies the particular application that created the file.  This code is used by the Finder to display the file's creator, such as "Microsoft Word document," and to determine which application to launch when you double-click on the file.

File In Use:  Indicates whether an application currently has the file open.

Creation and Modification Times:  Indicate when the file was created and when it was last modified.

Size:  All Macintosh files can have two parts: a resource fork and a data fork.  The resource fork includes program code, pictures, formatting information, and the like, while the data fork generally holds document data, such as a MacDraw picture or the text of a Microsoft Word document.  The size for the two parts of the file are displayed separately.

Has BNDL:  Indicates whether the file contains its own icon information.  Generally, the icons for documents are stored in the program that created them.  The Finder keeps track of them and displays the correct icon for each document by mapping them using the document's type and creator codes.  Thus applications generally have the BNDL flag set, while documents do not.

Shareable:  Indicates whether an application can be "shared," or run by multiple users simultaneously over a network.

Stationery:  This tells applications that support stationery that this is a read-only template document.  The application will copy the contents of this file into an untitled window and ask you to save it under a different name.

No INITs:  For extensions and control panels, this flag is set if the file has no INIT resources in it.  For applications, it indicates that the file should be opened read-only for network use.

Inited:  The Finder has "seen" the file and added the file's information to the Desktop database, where it keeps track of icons, file types, and creators.

Alias:  This file is an alias to another file.

Invisible:  The file or folder is invisible within the Finder and in most Open and Save dialog boxes.

Use Custom Icon:  The file has its own custom icon resource.

Importing and Exporting Link Sets

Default Folder enables you to export and import link sets as text files, so you can transfer or edit link sets in a text format.  This is very useful when changing the name of a hard disk, for example, or transferring link sets to a different machine with the same disk and folder layout.

Export

To export a link set, select the set and click on the "Export…" button in the control panel.  You  will be prompted to create a text file for the link set information.

The link set data is saved in tab-delimited text format.  Each line represents one folder link or locked folder, with tabs separating the pieces of information Default Folder needs to reconstruct the link set.  A simple example follows.

#BEGIN
LINKS
# Application
    Creator
   Path
#-----------
     ------
    ----
Eudora1.4.3
       CSOm
     File Box:Work:Product Release:
Microsoft Word
    MSWD
     File Box:Letters:
NCSA Telnet 2.6
   NCSA
     Super Disk:Communication:NCSA:
THINK Project Mgr  KAHL
     Haxdisk:My Stuff:Default Folder:cdev:
« DEFAULT LINK »
  Global Default Link
      File Box:Temp Folder:New Stuff:
#END
LINKS

#BEGIN
LOCKED
# Folder
          Path
#------
           ----
Mac #includes
     Haxdisk:Development:Symantec C++ for Macintosh:Inc 
New Stuff
         File Box:Temp Folder:New Stuff:
News
              File Box:News:
System Folder
     Apple Core:System Folder:
#END
LOCKED

The file is in two sections; one for the link information, and the other for the locked folder information.  Sections are delimited by the keywords #BEGIN and #END, with the section type, either LINKS or LOCKED, following the keyword.  

For links, each data line consists of an application name, creator name, and path name to the default folder.  In the path name, disks and folders are separated by colons.  The creator name may sometimes be blank (Note that two tabs in a row are needed to skip over an empty creator name field).  For locked folders, the data consists of the folder name and the full path name for the folder.

By using #INCLUDE followed by a tab and a file name, you can read in a file as part of another file.  This is useful if you want to set up a "core" set of links in one file and then include them in several link sets.

Any blank lines or lines beginning with a '#' character are skipped over when Default Folder reads the file back in, so that you may add comments or skip lines to make the file more readable.  When you export a link set, Default Folder adds comments to provide a summary of the file format at the top of the file.

Also note that the default link has the string "Global Default Link" as its creator name.  This must be there for it to be recognized as the default link when the data is imported into Default Folder.

Import  

To import a link set file, click on the "Import…" button in the control panel.  A file dialog box will allow you to select a text file to read in.  Note that the file name is used as the name of the new link set, so you may have to rename the file to avoid overwriting an existing link set.  Default Folder attempts to check each folder as the data is read in, and will give you a warning if it cannot find one of the linked folders.  Despite the warning, the link will still be put into the link set and will work properly if the folder appears at some later time.  If Default Folder encounters a line of data it can't recognize, it will show an error message and then continue at the next line.

Substitution Files

A substitution file provides a mechanism for Default Folder to look up names from a separate file and use them as part of the path name or application name in a link set.  This is useful when:

•  Each user on a network uses a different home folder on a server, but the basic folder structure is the same.  You can configure the substitution file on each machine once, then distribute a single link set to all machines that gets the home folder name from the substitution file. 

•  Default folders need to be changed on a schedule.  By renaming substitution files with AppleScript or Cron, default folders can be changed according to a class or shift schedule. 

To use substitution files you must first install the Substitutions plug-in extension for Default Folder.  To avoid confusion for the majority of our users, this extension is not included as part of the standard Default Folder package.  Please contact St. Clair Software for a free copy if you wish to try or use substitution files.

Once the Substitutions plug-in extension has been installed, link sets must be set up, exported to a text file, modified, and then imported back into the control panel.  In the text file, substitution "variables" are denoted with the special delimiters « (Option-Backslash) and » (Option-Shift-Backslash).  The name between these two delimiters is the lookup name -- Default Folder searches the substitution file for the name, followed by an equals sign (=) and the text to use as a replacement.  The substitution file must be named "DF Substitutions" and must be located in the Preferences folder within the System folder.

To provide a "Documents" default folder for Microsoft Word on a disk named "Art Dept. Server", for instance, the link set entry would look like this:

Microsoft Word
MSWD
«Server»:Documents:

and the substitution file would have an entry of:

Server=Art Dept. Server

Note that when importing a link set with substitutions, Default Folder will complain that it cannot find the named folders, since the names you supplied do not correspond to real folders.  These will be substituted correctly when Default Folder uses the substitution file during regular operation.

To use a different substitution file name, you must use ResEdit to change the 3rd string in STR# resource -4041 of the Default Folder control panel.  This is a full path name starting from the Preferences folder, so it might be ":Config:User Data" if it's a file named "User Data" in the "Config" folder within the Preferences folder.  If it's simply a file named "Subs" in the Preferences folder, the third string in STR# -4041 would be simply "Subs."  Don't forget the leading colon if the file is in a sub-folder.

The first and second strings in STR# -4041 allow you to change the start and stop delimiters, respectively, and are initially set to « and » (option-backslash and option-shift-backslash).  

Note that in order for a new substitution file name or delimiter to be recognized, the Macintosh must be restarted after STR# -4041 is changed.  However, if the link set or substitution file is modified, the link set will automatically be reloaded and the substitutions recomputed with the new settings -- there is no need to restart.